package com.mysoft.gfyx.common.ycg.impl;

import com.mysoft.gfyx.common.ycg.YcgFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

import java.util.Objects;

@Service
public class YcgFileServiceImpl implements YcgFileService {
    @Autowired
    private Environment environment;

    public String getEnterpriseLogo(String developerId, String developerLogo) {
        // 处理Logo
        if (Objects.equals(developerId, "") || Objects.equals(developerLogo, "")) {
            return "";
        } else {
            return environment.getProperty("static-resource.ycgstatic") + "/company/"
                    + developerId + ".80x80.jpg?v=" + developerLogo;
        }
    }

}
